/*
 * @Author: xmily
 * @Date: 2020-10-25 23:07:30
 * @LastEditors: xmily
 * @LastEditTime: 2022-03-01 11:39:45
 * @FilePath: \glxxapi\NOSQL.js
 * @Description: 
 * 
 * Copyright (c) 2022 by xmily/mxthink.com.cn, All Rights Reserved. 
 */
db.base.update(
   {"teaching":{$exists:1}},
   { $push: { "teaching.$[t].subject": '信息技术' } },
   { arrayFilters: [ { "t.term": "2018年春季学期" }],upsert : true, multi: true}
)

//查询出只上基础课的学生
db.getCollection("aftclsvr_application").find({
   $and: [{
       $and: [
           {
               "month": "3"
           },
           {
               "term": "2022春季"
           },
           {
               "status": {
                   $nin: ["已分配", "退出"]
               }
           },
           
       ]
   }, {
       $or: [
           {
               "interestlesson": []
           },
           {
               "interestlesson": [null, null]
           }
       ]
   }]
}, {
   "applicationwrite": 0,
   "safewrite": 0
})